package swu.cx.recyclerviewtest

class Repository {
    private val localDatas = mutableListOf<datas>()
     var datas = listOf<datas>()
        get() {
            getData()
            field = localDatas.toList()
            return field
        }
    companion object{
        val instance:Repository by lazy(LazyThreadSafetyMode.SYNCHRONIZED){
            Repository()
        }
    }
    fun getData(){
        val datasProvider:Factory = LocalUtil()
        localDatas.addAll(datasProvider.generateDatas())
    }
}